Dynomotion

Group: DynoMotion Message: 13147 From: kajetan21 Date: 4/16/2016
Subject: Is Interrupt Driven GPIO Possible on Kflop?
Hello there, I'm having problems with sporadic limit switch triggering, most likely due to  EMI.  I'm looking for some C code that would get executed as soon as the signal on one of the GPIO pins changes, even if for a very short time.

It looks like most of the stuff on the K-Flop is implemented though polling.  Problem with that of course is one can easily miss a quick blip on an input if it happens to occur in between the time when the input is checked through each iteration of the loop.

Would love to see some simple C for an ISR (interrupt service routine). All I want right now is to turn on one of the on board LEDs and keep it on forever, as soon as a change on one of the GPIO pins is detected.

If this is not possible, would it make sense to have the same polling code running on all of the "threads" to maximize my chance of detecting a change on the GPIO pin?

Would anyone care to provide feed back?  Am I totally crazy?  Does this seem like a good strategy?

Kai.
Group: DynoMotion Message: 13148 From: carlcnc Date: 4/16/2016
Subject: Re: Is Interrupt Driven GPIO Possible on Kflop?
Kai
   
please tell me what type system you are running,
Kflop+Kstep?
Kflop and 3rd party step drives?
Snapamp ?
3rd party servo??
 what io bits [pins] are you connecting your limits to?
given that most of kflops io are 3.3v , a few are 5v both are highly  susceptible to emf/noise.
better to figure a way to go to 12 or 24v if possible

Carl
Group: DynoMotion Message: 13152 From: kajetan21 Date: 4/17/2016
Subject: Re: Is Interrupt Driven GPIO Possible on Kflop?
Hello Carl,

Thank you for replying so quickly.  We are running the Kflop plus four Gekos (G203V) driving four steppers rated for 3.5A.  The Gecko drivers are powered by a 120V->48V 20.8A transformer that is rectified and cap filtered, but not regulated (as the Gecko instructions recommend).

Our limit/homing sensors are on IO0, IO1 and IO2.

From the start we implemented a differential signaling scheme (TI uA9638C and TI uA9637AC) using CAT5e TP.  Despite the diff driver, we were still plagued by regular blips on the sensors.

I next managed to convince by project partner (he's more on the mechanical side of things) that we need shielded CAT6 for our diff pairs and shielded power cables to carry the power from out power supply to each Gecko.  Now that this is done, I now want to make sure the blips are dead for good and so I broke out the scope.  Even with all the shielded cabling we are still getting spikes of over 0.8V on the IO lines of the Kflop with just piece of jumper cable (induced I'm assuming).  I'd like to be really sure that the Kflop is not going to interpret those spikes as a valid signal.  The spikes seen are of about 20MHz frequency, I'm pretty sure they are caused by the MOSFET switching on the Gecko that is causing this.

I would be happy to provide any additional info.

Kai.




---In DynoMotion@yahoogroups.com, <carlcnc@...> wrote :

Kai
   
please tell me what type system you are running,
Kflop+Kstep?
Kflop and 3rd party step drives?
Snapamp ?
3rd party servo??
 what io bits [pins] are you connecting your limits to?
given that most of kflops io are 3.3v , a few are 5v both are highly  susceptible to emf/noise.
better to figure a way to go to 12 or 24v if possible

Carl
Group: DynoMotion Message: 13153 From: carlcnc Date: 4/17/2016
Subject: Re: Is Interrupt Driven GPIO Possible on Kflop?
Kai
    you do know that IO 0,1,2, are only for 3.3 signals?whilst 5v won't necessarily damage anything
 sinking 5v to them can be problematic
   many of them are  low on startup unless you put a 5-10K resistor from io pin to
the 3.3v pin
  not clear on what type of switches you are using,
prox?,optical or standard microswitches?
 
if you aren't using it for S/D signals  try connecting to the rj45[jp8] as they are 5v tolerant
 see the kflop help files for IO bit to pin definition

before Tom came out with the Kstep, I often used opto22 input relays then connected their output to kflop
this allowed me to use 12-24 v on my limit circuits
Group: DynoMotion Message: 13155 From: kajetan21 Date: 4/17/2016
Subject: Re: Is Interrupt Driven GPIO Possible on Kflop?
Hello Carl,

The sensor we are using is a Groove Opto Coupler Optical Sensor Module (SCU1017) :

http://www.electrodragon.com/product/groove-opto-coupler-optical-sensor-for-arduino-speed-counting/

It's connected as follows:

sensor module ->  jumper cable -> UA9638C-EP on a proto board -> shielded CAT6 ->  uA9637AC on a proto board -> jumper cable -> Kflop IO

http://www.ti.com/product/UA9638C-EP
http://www.ti.com/product/UA9637A

Just looking at the datasheet now, the UA9637A is a 5V TTL device, so we are driving IO0, IO1 and IO2 with 5V.  Probably should not be doing that.  I will see if I can find a 3.3 VLTTL variant of the UA9637A.

I don't have any experience with Opto22, looking at their website it looks like they sell some nice things.

I'm working on tidying up things and then I can takes some photos to illustrate.

Regards,
Kai.
Group: DynoMotion Message: 13157 From: carlcnc Date: 4/18/2016
Subject: Re: Is Interrupt Driven GPIO Possible on Kflop?
Kai
      I have been "bitten" by noisy 5v supplies , and even a faulty rectifier on  a large supply that caused noise to sensitive low voltage circuits, confirmed that with use a scope.
 if changing your input relay doesn't solve the issue, then it might save you  time to do the same

the opto 22 relays are good, you can usually find them on ebay for a few dollars